How can I fix the `NameError` caused by using variables defined in different functions

join shbcf.ru